package com.common.spring.advice;

import java.util.Date;

import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.InitBinder;

import com.common.jackson.time.DateParser;
import com.common.spring.binder.DateBinder;

@ControllerAdvice
public class BinderAdvice {
	@InitBinder
	public void initBinder(WebDataBinder binder) {
		binder.registerCustomEditor(Date.class, new DateBinder(new DateParser()));
	}
}
